Skip to content

build: run Vite+'s type-aware lint on tsrs's own linter - #754

Merged
ian-pascoe merged 4 commits into
build/vite-plus-pnpmfrom
tsrslint-under-vite-plus
Nov 13, 2026
Merged

ian-pascoe merged 4 commits into
build/vite-plus-pnpmfrom
tsrslint-under-vite-plus

Conversation

@ian-pascoe

@ian-pascoe ian-pascoe commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Stacked on #753. Vite+'s type-aware lint (the part of vp lint, vp check and vp staged that type-checks) runs on tsrs's own linter, tsrs-lint, instead of Vite+'s bundled tsgolint (ADR-0055 → Consequences). tsrs 0.21 and later ship it: tsgolint's headless protocol and its 61 type-aware rules.

vp lint
  OXLINT_TSGOLINT_PATH = resolve("oxlint-tsgolint/bin/tsgolint")   # Vite+ sets it itself
    oxlint-tsgolint → link:./tools/tsrs-lint-shim                  # pnpm-workspace.yaml override
      bin/tsgolint.js → the `tsrs` package's `tsrs-lint` bin, in-process
  • The shim has no package.json on purpose. With one, the effect-tsgo patch step in prepare mistakes it for Vite+'s oxlint-tsgolint and fails the install.
  • tsrs here is the linter only. The typecheck is still effect-tsgo tsrs.

Evidence

Whole-repo vp lint with type-check, two runs each, macOS arm64:

Backend Wall CPU Peak memory
tsgolint 7.0.2004 (#753) 16 s 48 s 3.6 GB
tsrslint 0.1.6 (first version of this PR) 9–10 s 13–14 s 1.5–2.1 GB
tsrs 0.24 tsrs-lint (this PR) 7–8 s 15 s 0.9–1.0 GB
  • Still type-aware: a probe file reports typescript(TS2322) and no-floating-promises.
  • Local checks pass: vp check, vp run -r typecheck (16/16), prepare and git-install:check.
  • Tests: vp run -r test passed 16/16. Two runs of the server suite each hit a different timing failure while load average was around 20 from other sessions. Each failing file then passed on its own, and the server suite passed in full once load dropped.

Merge Danger

Door: two-way. Removing the override and tsrs puts back Vite+'s tsgolint.

Blast Radius: lint. Ways it can break:

  • A Vite+ upgrade. If Vite+ starts looking for its backend elsewhere, vp lint fails loudly with Error running tsgolint. dependencies.md has the check to run on an upgrade.
  • Windows. Vite+ looks for tsgolint.exe or .cmd there, so the shim doesn't run. macOS and Linux, including CI and the Container, are covered.
  • Version pin. tsrs is pinned at 0.24 because 0.25 was still under pnpm's day-old minimum release age.

Plan

  • The owner asked to bring tsrs back under Vite+ as a follow-up to build: install with pnpm and check, lint, format and run tasks with Vite+ #753, then to "switch to the official cli".
  • So vp lint and vp check now run the tsrs package's tsrs-lint as the type-aware backend, keeping type-check and the type-aware rules.
  • ADR-0055, ADR-0028's status line and dependencies.md say so.
  • The shim-free route waits. It is effect-tsgo --tsrs-lint vp lint (@effect/tsgo 0.68 and later), which needs oxlint 1.91 or later, so a Vite+ past 1.4.0. That waits on the Vitest 5.1 workerd issue.

vp lint runs the bin/tsgolint of its own oxlint-tsgolint, so a pnpm
override makes that package tools/tsrslint-shim, which runs
@maschwenk/tsrslint's binary. A whole-repo vp lint takes 9-10 s and
2 GB at most, against 16 s and 3.6 GB on Vite+'s tsgolint.
@ian-pascoe

Copy link
Copy Markdown
Owner Author

Review report for head 69594ec311c1afe5e3c520093a4cdb35877bafcc (code-review against origin/build/vite-plus-pnpm): Standards and Spec, no blockers after one round (2.1 GB figure, resolution-order comment, older-Node fallback fixed in 69594ec). Dismissed: amending ADR-0055 in place (unmerged, on this PR's base); no error handler on the fallback child (binaryPath() throws first on a missing binary; exits non-zero either way).

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Preview deployed

URL: https://cloudpid-server-pr-754.ian-g-pascoe.workers.dev

Built from eb2a890 (stage pr-754, behind Access). It is destroyed when the
pull request is closed.


This comment updates on each push.

tsrs 0.21 ships tsgolint's port as tsrs-lint, so the shim loads the
tsrs package's linter in place of @maschwenk/tsrslint. A whole-repo
vp lint takes 7-8 s and 1 GB at most.
@ian-pascoe ian-pascoe changed the title build: run Vite+'s type-aware lint on tsrslint build: run Vite+'s type-aware lint on tsrs's own linter Nov 12, 2026
@ian-pascoe

Copy link
Copy Markdown
Owner Author

Review report for head 0eadb180638047603b76c668edc05568d7cc0c83 (code-review against origin/build/vite-plus-pnpm, the switch to tsrs's official tsrs-lint): Standards and Spec, no blockers after one round. Fixed: ADR-0055's sentence on what is replaced, the Windows limit, the 0.24 pin's reason, the drop instruction, and the shim now loads tsrs-lint by the package's bin entry rather than a file outside its exports. Dismissed: amending ADR-0055 in place (unmerged, on this PR's base).

@ian-pascoe
ian-pascoe merged commit 0eadb18 into build/vite-plus-pnpm Nov 13, 2026
16 checks passed
@ian-pascoe
ian-pascoe deleted the tsrslint-under-vite-plus branch November 13, 2026 10:44
@ian-pascoe

Copy link
Copy Markdown
Owner Author

Folded into #753 at the owner's request: #753's branch was fast-forwarded to this PR's head (0eadb18), so all four commits are now in #753.

This branch was successfully deployed

1 active deployment
preview — 0eadb180 Deployed Nov 13, 2026 by ian-pascoe via Preview #1390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant